<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">


<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    
    <title>Asyncio Documentation &#8212; Asyncio Documentation 0.0 documentation</title>
    
    <link rel="stylesheet" href="_static/alabaster.css" type="text/css" />
    <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
    <link rel="stylesheet" href="https://media.readthedocs.org/css/badge_only.css" type="text/css" />
    
    <script type="text/javascript">
      var DOCUMENTATION_OPTIONS = {
        URL_ROOT:    './',
        VERSION:     '0.0',
        COLLAPSE_INDEX: false,
        FILE_SUFFIX: '.html',
        HAS_SOURCE:  true,
        SOURCELINK_SUFFIX: '.txt'
      };
    </script>
    <script type="text/javascript" src="https://media.readthedocs.org/javascript/jquery/jquery-2.0.3.min.js"></script>
    <script type="text/javascript" src="https://media.readthedocs.org/javascript/jquery/jquery-migrate-1.2.1.min.js"></script>
    <script type="text/javascript" src="https://media.readthedocs.org/javascript/underscore.js"></script>
    <script type="text/javascript" src="https://media.readthedocs.org/javascript/doctools.js"></script>
    <script type="text/javascript" src="https://media.readthedocs.org/javascript/readthedocs-doc-embed.js"></script>
    <link rel="index" title="Index" href="genindex.html" />
    <link rel="search" title="Search" href="search.html" />
    <link rel="next" title="Why use asyncio?" href="why_asyncio.html" />
   
  <link rel="stylesheet" href="_static/custom.css" type="text/css" />
  
  
  <meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9" />

  
<!-- RTD Extra Head -->

<!-- 
Always link to the latest version, as canonical.
http://docs.readthedocs.org/en/latest/canonical.html
-->
<link rel="canonical" href="http://asyncio.readthedocs.io/en/latest/" />

<link rel="stylesheet" href="https://media.readthedocs.org/css/readthedocs-doc-embed.css" type="text/css" />

<script type="text/javascript" src="_static/readthedocs-data.js"></script>

<!-- Add page-specific data, which must exist in the page js, not global -->
<script type="text/javascript">
READTHEDOCS_DATA['page'] = 'index' 		
READTHEDOCS_DATA['source_suffix'] = '.rst'
</script>

<script type="text/javascript" src="_static/readthedocs-dynamic-include.js"></script>

<!-- end RTD <extrahead> --></head>
  <body role="document">
  

    <div class="document">
      <div class="documentwrapper">
        <div class="bodywrapper">
          <div class="body" role="main">
            
  <div class="section" id="asyncio-documentation">
<h1>Asyncio Documentation<a class="headerlink" href="#asyncio-documentation" title="Permalink to this headline">¶</a></h1>
<div class="section" id="chapter-1-first-steps-with-asyncio">
<h2>Chapter 1: First steps with asyncio<a class="headerlink" href="#chapter-1-first-steps-with-asyncio" title="Permalink to this headline">¶</a></h2>
<div class="toctree-wrapper compound">
<ul>
<li class="toctree-l1"><a class="reference internal" href="why_asyncio.html">Why use asyncio?</a><ul>
<li class="toctree-l2"><a class="reference internal" href="why_asyncio.html#why-asynchronous-programming">Why asynchronous programming?</a></li>
<li class="toctree-l2"><a class="reference internal" href="why_asyncio.html#but-gevent-and-eventlet-just-work">But gevent and eventlet just work!</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="getting_started.html">Getting Started</a><ul>
<li class="toctree-l2"><a class="reference internal" href="getting_started.html#python-3-5-or-higher-only">Python 3.5 (or higher) only</a></li>
<li class="toctree-l2"><a class="reference internal" href="getting_started.html#create-a-virtual-environment-to-run-examples">Create a virtual environment to run examples</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="hello_world.html">Hello World</a><ul>
<li class="toctree-l2"><a class="reference internal" href="hello_world.html#simple-coroutine">Simple coroutine</a></li>
<li class="toctree-l2"><a class="reference internal" href="hello_world.html#creating-tasks">Creating tasks</a></li>
<li class="toctree-l2"><a class="reference internal" href="hello_world.html#stopping-the-loop">Stopping the loop</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="hello_clock.html">Hello Clock</a></li>
<li class="toctree-l1"><a class="reference internal" href="http_client.html">HTTP client example</a></li>
<li class="toctree-l1"><a class="reference internal" href="performance.html">asyncio performance</a><ul>
<li class="toctree-l2"><a class="reference internal" href="performance.html#architecture-worker-processes">Architecture: Worker processes</a></li>
<li class="toctree-l2"><a class="reference internal" href="performance.html#stream-limits">Stream limits</a></li>
<li class="toctree-l2"><a class="reference internal" href="performance.html#tcp-nodelay">TCP_NODELAY</a></li>
<li class="toctree-l2"><a class="reference internal" href="performance.html#tcp-quickack">TCP_QUICKACK</a></li>
<li class="toctree-l2"><a class="reference internal" href="performance.html#tune-the-linux-kernel">Tune the Linux kernel</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="twisted.html">Learn asyncio if you come from Twisted</a><ul>
<li class="toctree-l2"><a class="reference internal" href="twisted.html#rosetta-stone">Rosetta Stone</a></li>
<li class="toctree-l2"><a class="reference internal" href="twisted.html#deferred-example">Deferred example</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="getting_help.html">Getting Help</a><ul>
<li class="toctree-l2"><a class="reference internal" href="getting_help.html#mailing-list">Mailing list</a></li>
<li class="toctree-l2"><a class="reference internal" href="getting_help.html#stackoverflow">StackOverflow</a></li>
<li class="toctree-l2"><a class="reference internal" href="getting_help.html#irc">IRC</a></li>
</ul>
</li>
</ul>
</div>
</div>
<div class="section" id="chapter-2-advanced-topics">
<h2>Chapter 2: Advanced topics<a class="headerlink" href="#chapter-2-advanced-topics" title="Permalink to this headline">¶</a></h2>
<div class="toctree-wrapper compound">
<ul>
<li class="toctree-l1"><a class="reference internal" href="tcp_echo.html">TCP echo client and server</a><ul>
<li class="toctree-l2"><a class="reference internal" href="tcp_echo.html#tcp-echo-client">TCP echo client</a></li>
<li class="toctree-l2"><a class="reference internal" href="tcp_echo.html#tcp-echo-server">TCP echo server</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="threads.html">Threads</a></li>
<li class="toctree-l1"><a class="reference internal" href="subprocess.html">Subprocess</a><ul>
<li class="toctree-l2"><a class="reference internal" href="subprocess.html#run-a-subprocess-and-read-its-output">Run a subprocess and read its output</a></li>
<li class="toctree-l2"><a class="reference internal" href="subprocess.html#communicate-with-a-subprocess-using-standard-streams">Communicate with a subprocess using standard streams</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="producer_consumer.html">Producer/consumer</a><ul>
<li class="toctree-l2"><a class="reference internal" href="producer_consumer.html#simple-example">Simple example</a></li>
<li class="toctree-l2"><a class="reference internal" href="producer_consumer.html#using-task-done">Using task_done()</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="debug_mode.html">Asyncio Debug Mode</a></li>
</ul>
</div>
</div>
<div class="section" id="chapter-3-larger-examples">
<h2>Chapter 3: Larger examples<a class="headerlink" href="#chapter-3-larger-examples" title="Permalink to this headline">¶</a></h2>
<div class="toctree-wrapper compound">
<ul>
<li class="toctree-l1"><a class="reference internal" href="webscraper.html">Web Scraping</a><ul>
<li class="toctree-l2"><a class="reference internal" href="webscraper.html#a-mock-web-server">A Mock Web Server</a></li>
<li class="toctree-l2"><a class="reference internal" href="webscraper.html#a-synchronous-client">A Synchronous Client</a></li>
<li class="toctree-l2"><a class="reference internal" href="webscraper.html#getting-one-page-asynchronously">Getting One Page Asynchronously</a></li>
<li class="toctree-l2"><a class="reference internal" href="webscraper.html#getting-multiple-pages-asynchronously-without-time-savings">Getting Multiple Pages Asynchronously - Without Time Savings</a></li>
<li class="toctree-l2"><a class="reference internal" href="webscraper.html#getting-multiple-pages-asynchronously-with-time-savings">Getting Multiple Pages Asynchronously - With Time Savings</a></li>
<li class="toctree-l2"><a class="reference internal" href="webscraper.html#high-level-approach-with-aiohttp">High-Level Approach with <code class="docutils literal"><span class="pre">aiohttp</span></code></a></li>
</ul>
</li>
</ul>
</div>
</div>
<div class="section" id="indices-and-tables">
<h2>Indices and tables<a class="headerlink" href="#indices-and-tables" title="Permalink to this headline">¶</a></h2>
<div class="toctree-wrapper compound">
<ul>
<li class="toctree-l1"><a class="reference internal" href="glossary.html">Glossary</a></li>
</ul>
</div>
</div>
<div class="section" id="see-also">
<h2>See also<a class="headerlink" href="#see-also" title="Permalink to this headline">¶</a></h2>
<ul class="simple">
<li><a class="reference external" href="https://github.com/python/asyncio/wiki">asyncio wiki</a></li>
<li><a class="reference external" href="https://docs.python.org/dev/library/asyncio.html">asyncio Reference Documentation</a>.</li>
<li><a class="reference external" href="http://aosabook.org/en/500L/a-web-crawler-with-asyncio-coroutines.html">A Web Crawler With asyncio Coroutines</a>
by A. Jesse Jiryu Davis and Guido van Rossum</li>
<li><a class="reference external" href="http://jamesls.com/writing-redis-in-python-with-asyncio-part-1.html">Writing Redis in Python with asyncio: Part 1</a>
by James Saryerwinnie</li>
</ul>
</div>
<div class="section" id="contributing">
<h2>Contributing<a class="headerlink" href="#contributing" title="Permalink to this headline">¶</a></h2>
<div class="toctree-wrapper compound">
<ul>
<li class="toctree-l1"><a class="reference internal" href="README.html">Asyncio documentation</a></li>
<li class="toctree-l1"><a class="reference internal" href="README.html#notes-to-writers">Notes to writers</a></li>
<li class="toctree-l1"><a class="reference internal" href="README.html#ideas">Ideas</a></li>
<li class="toctree-l1"><a class="reference internal" href="README.html#how-to-install-sphinx">How to install Sphinx</a></li>
<li class="toctree-l1"><a class="reference internal" href="README.html#how-to-build-the-documentation">How to build the documentation</a></li>
<li class="toctree-l1"><a class="reference internal" href="README.html#see-also">See also</a></li>
</ul>
</div>
</div>
</div>


          </div>
        </div>
      </div>
      <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
        <div class="sphinxsidebarwrapper">
<h1 class="logo"><a href="#">Asyncio Documentation</a></h1>






<p>
<iframe src="https://ghbtns.com/github-btn.html?user=asyncio-doc&repo=asyncio-doc&type=star&count=true&size=large&v=2"
  allowtransparency="true" frameborder="0" scrolling="0" width="200px" height="35px"></iframe>
</p>





<h3>Navigation</h3>
<ul>
<li class="toctree-l1"><a class="reference internal" href="why_asyncio.html">Why use asyncio?</a></li>
<li class="toctree-l1"><a class="reference internal" href="getting_started.html">Getting Started</a></li>
<li class="toctree-l1"><a class="reference internal" href="hello_world.html">Hello World</a></li>
<li class="toctree-l1"><a class="reference internal" href="hello_clock.html">Hello Clock</a></li>
<li class="toctree-l1"><a class="reference internal" href="http_client.html">HTTP client example</a></li>
<li class="toctree-l1"><a class="reference internal" href="performance.html">asyncio performance</a></li>
<li class="toctree-l1"><a class="reference internal" href="twisted.html">Learn asyncio if you come from Twisted</a></li>
<li class="toctree-l1"><a class="reference internal" href="getting_help.html">Getting Help</a></li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="tcp_echo.html">TCP echo client and server</a></li>
<li class="toctree-l1"><a class="reference internal" href="threads.html">Threads</a></li>
<li class="toctree-l1"><a class="reference internal" href="subprocess.html">Subprocess</a></li>
<li class="toctree-l1"><a class="reference internal" href="producer_consumer.html">Producer/consumer</a></li>
<li class="toctree-l1"><a class="reference internal" href="debug_mode.html">Asyncio Debug Mode</a></li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="webscraper.html">Web Scraping</a></li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="glossary.html">Glossary</a></li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="README.html">Asyncio documentation</a></li>
<li class="toctree-l1"><a class="reference internal" href="README.html#notes-to-writers">Notes to writers</a></li>
<li class="toctree-l1"><a class="reference internal" href="README.html#ideas">Ideas</a></li>
<li class="toctree-l1"><a class="reference internal" href="README.html#how-to-install-sphinx">How to install Sphinx</a></li>
<li class="toctree-l1"><a class="reference internal" href="README.html#how-to-build-the-documentation">How to build the documentation</a></li>
<li class="toctree-l1"><a class="reference internal" href="README.html#see-also">See also</a></li>
</ul>

<div class="relations">
<h3>Related Topics</h3>
<ul>
  <li><a href="#">Documentation overview</a><ul>
      <li>Next: <a href="why_asyncio.html" title="next chapter">Why use asyncio?</a></li>
  </ul></li>
</ul>
</div>
<div id="searchbox" style="display: none" role="search">
  <h3>Quick search</h3>
    <form class="search" action="search.html" method="get">
      <div><input type="text" name="q" /></div>
      <div><input type="submit" value="Go" /></div>
      <input type="hidden" name="check_keywords" value="yes" />
      <input type="hidden" name="area" value="default" />
    </form>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
  <h3><a href="#">Table Of Contents</a></h3>
  <ul>
<li><a class="reference internal" href="#">Asyncio Documentation</a><ul>
<li><a class="reference internal" href="#chapter-1-first-steps-with-asyncio">Chapter 1: First steps with asyncio</a></li>
<li><a class="reference internal" href="#chapter-2-advanced-topics">Chapter 2: Advanced topics</a></li>
<li><a class="reference internal" href="#chapter-3-larger-examples">Chapter 3: Larger examples</a></li>
<li><a class="reference internal" href="#indices-and-tables">Indices and tables</a></li>
<li><a class="reference internal" href="#see-also">See also</a></li>
<li><a class="reference internal" href="#contributing">Contributing</a></li>
</ul>
</li>
</ul>

  <div role="note" aria-label="source link">
    <h3>This Page</h3>
    <ul class="this-page-menu">
      <li><a href="_sources/index.rst.txt"
            rel="nofollow">Show Source</a></li>
    </ul>
   </div>
        </div>
      </div>
      <div class="clearer"></div>
    </div>
    <div class="footer">
      &copy;2016, Victor Stinner.
      
      |
      Powered by <a href="http://sphinx-doc.org/">Sphinx 1.5.3</a>
      &amp; <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.10</a>
      
      |
      <a href="_sources/index.rst.txt"
          rel="nofollow">Page source</a>
    </div>

    
    <a href="https://github.com/asyncio-doc/asyncio-doc" class="github">
        <img style="position: absolute; top: 0; right: 0; border: 0;" src="https://s3.amazonaws.com/github/ribbons/forkme_right_darkblue_121621.png" alt="Fork me on GitHub"  class="github"/>
    </a>
    

    
  </body>
</html>